#!/usr/bin/env python
# -*- coding: utf-8 -*-
# common (misc) def, const, etc.

#constant
GDATA_ENCODE = u'utf-8' #よくわからないが、少なくとも Picasa web album は UTF-8 でいいようだ
TAG_ENCODE = u'utf-8'   #TAGのExportはUTF-8で出しとく

KML_LIMIT_SIZE = 1024 * 1024 * 10       #Google Mapで読み込める最大サイズは10Mまで。(unuse 2010-03-02 :-)

FIXED_TITLE = [u'album_id',
               u'album_title',
               u'album_link',
               u'album_thumbnail',
               u'photo_id',
               u'photo_title',
               u'photo_link',
               u'photo_thumbnail']

def uni(s, encode) :
    if s != None :
        return unicode(s, encode)
    else :
        return u''

def getTagList(map) :
    list = [''] * len(map)
    for item in map.keys() :
        list[map[item]] += item
    return list

def invalidAccess(option, album_access) :
    #checking access.... public -> only 'public', protected -> 'public' and 'protected'
    return  ((option == u'public' and album_access != u'public') or
             (option == u'protected' and (album_access != u'public' and album_access != u'protected')))


